package co.yixiang.modules.shop.repository;

import co.yixiang.modules.shop.domain.YxStoreProductLock;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
* @author frq
* @date 2020-06-28
*/
public interface YxStoreProductLockRepository extends JpaRepository<YxStoreProductLock, Integer>, JpaSpecificationExecutor<YxStoreProductLock> {
    @Modifying
    @Query(value = "update yx_store_product_lock set releaser=?2 , release_time=NOW() where product_Id=?1",nativeQuery = true)
    void updateReleaser(String id,String releaser);
}